﻿using System;

namespace Website_ES
{
    public partial class homeLogin : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["Usuario"] != null)
            {                
              //  string permis = Request.QueryString["Permission"];

                LabelName.Text = Session["Usuario"].ToString(); // Request.QueryString["ID"];

                if (Session["Permissao"].ToString() == "ADM" || Session["Permissao"].ToString() == "FUNC")
                {
                    LinkButtonCadastrarInstr.Visible = true;
                    LinkButtonInformPromo.Visible = true;
                    LinkButtonRegDevol.Visible = true;

                    if (Session["Permissao"].ToString() == "ADM")
                        LinkButtonRegFunc.Visible = true;
                }
            }
            else
                Response.Redirect("Home.aspx");
        }

        protected void LinkButtonAlterCadastr_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Account/AlterarCadastro.aspx");
        }

        protected void LinkButtonLogout_Click(object sender, EventArgs e)
        {
            Session["Usuario"] = null;
            Session["Permissao"] = null;
            Response.Redirect("Home.aspx");
        }

        protected void LinkButtonProcurarInstr_Click(object sender, EventArgs e)
        {

        }

        protected void LinkButtonRealizarEmp_Click(object sender, EventArgs e)
        {

        }

        protected void LinkButtonRenovEmp_Click(object sender, EventArgs e)
        {

        }

        protected void LinkButtonInformPromo_Click(object sender, EventArgs e)
        {

        }

        protected void LinkButtonRegFunc_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Account/Register.aspx?TYPE=FUNC");
        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {

        }
    }
}